﻿/*
    + Auto load page
    + Author: NguyenTV
    + Create: 09/09/2013
*/
var pageIndex = 0; //Trang bắt đầu
var maxPage = 100; //Số lượng trang load tối đa
/************************************************/

$(document).ready(function () {
    GetRecordLogGold();
    //
});

// Get danh sách lịch sử nạp Gold
function GetRecordLogGold() {
    pageIndex++;
    if (pageIndex >= 1 && pageIndex <= maxPage) {
        $('#notifition').slideDown("fast");
        $('#notifition .msg-page').text('Đang load dữ liệu...');
        $("#btnLoadMore").hide();
        $("#loader").show();
        $.ajax({
            type: "POST",
            url: "/Default.aspx/fncGetLogGold",
            data: '{iPageIndex: ' + pageIndex
            + '}',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                var Data = response.d;
                $("#LogGold").append(Data);
                $('#notifition').slideUp("fast");
                $("#loader").hide();
                $("#btnLoadMore").show();
                if (Data == "") { $("#btnLoadMore").hide(); }},
            failure: function (response) {
                //alert("failure: " + response.d);
            },
            error: function (response) {
                //alert("error: " + response.d);
            }
        });
    }
}